<!DOCTYPE html	PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<ui:composition xmlns="http://www.w3.org/1999/xhtml" xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:h="http://java.sun.com/jsf/html" xmlns:f="http://java.sun.com/jsf/core"
	xmlns:p="http://primefaces.org/ui" xmlns:s="http://sduept.security.el/func"
	template="/template/template_dialog.xhtml">
<ui:define name="head">
	<!-- <link href="/css/primefaces/menubase.css" rel="stylesheet"
		type="text/css" /> -->
	<title>评价详情页</title>
	<style type="text/css">
	.value {
		font-weight: bold;
	}
	.ui-datatable th.ui-state-default, .ui-datatable tfoot td.ui-state-default {
	    background: #ddd;
	    border-color: #999;
	    border-bottom: 1px solid #999;
	    color:#222;
	    font-weight: bold;
	}
	

	.ui-widget-header .ui-inputfield, .ui-widget-content .ui-inputfield {
	    font-weight: normal;
	    width: 80%;
	}
	
.ui-panelgrid .ui-panelgrid-cell {
    border-width: 0px;
    border-style: solid;
    border-color: inherit;
    padding: 4px 10px;
}
ol, ul {
    margin-top: 0;
    margin-bottom: 10px;
    padding-left: 22px;
}
.feedbackDialog .ui-dialog-titlebar {
    margin: 0px;
    padding: 0px;
}
.imagebox a {
	margin-left:10px;
}
.ui-panel .ui-panel-content {
    border: 0;
    background: 0;
    padding: 0;
}
.loadingCover {
	position:absolute;left:0px;top:0px;
    background:rgba(0, 0, 0, 0.8);
    width:100%;  /*宽度设置为100%，这样才能使隐藏背景层覆盖原页面*/
    height:100%;
    filter:alpha(opacity=60);  /*设置透明度为60%*/
    opacity:0.6;  /*非IE浏览器下设置透明度为60%*/
    z-index:112999;
}
	</style>
		<script>
			$(function() {
				setDtHeight();
				hiddenLoadingTip();
			})
			function hiddenLoadingTip() {
				$('#loadingTip').hide();
				layer.msg('评价项导入完成！');
			}
			//设置评价详细dataTable的高度
			function setDtHeight(scrollTop) {
				var height = $(window).height();//当前窗口的高度
				var dtHeight = height-170;
				$('.ui-datatable-scrollable-body').attr('style','height:'+dtHeight+'px');
				document.getElementsByClassName("ui-datatable-scrollable-body")[0].style.overflowY = "scroll";
				//设置滚动条位置
				if(scrollTop) {
					$(".ui-datatable-scrollable-body").animate({scrollTop:scrollTop},0);
				}
			}
			function getScrollTop() {
				var target = $(".ui-datatable-scrollable-body>table>tbody>tr[data-ri='180']");
				var scrollTop = 0;
				var prevTreList = target.prevAll();
				prevTreList.each(function(i) {
					scrollTop += $(this).outerHeight();
				});
				return scrollTop;
			}
			
			var scrollTop;
			var quesEquipmentDialogSrc;
			var quesEquipmentDialogIndex;
			function openQuestionEquipmentDialog(itemId, deductionCriteria,stationId,planStationId,planId,index) {
				scrollTop = $(".ui-datatable-scrollable-body").scrollTop();
				quesEquipmentDialogSrc = '/ui/common/questionEquipmentDesc.xhtml?itemId='
						+ itemId
						+ '&amp;deductionCriteria='
						+ deductionCriteria
						+ '&amp;stationId='
						+ stationId
						+ '&amp;planStationId='
						+ planStationId
						+ '&amp;planId='
						+ planId
						+ '&amp;index='
						+ index;
				quesEquipmentDialogIndex = layer.open({
					type : 2,
					maxmin : false,
					area : [ '75%', '90%' ],
					fixed : false, //不固定
					title : '问题追加',
					maxmin : true,	
									
					content : quesEquipmentDialogSrc,
				});

			}
			
			var needQuesDialogIndex;
			var questionDialogSrc;
			function openQuestionDialog(id) {
				questionDialogSrc = '/ui/common/problembase_selector_single.xhtml?descId='
						+ id;
				needQuesDialogIndex = layer.open({
					type : 2,
					maxmin : false,
					area : [ '1000px', '632px' ],
					fixed : false, //不固定
					title : '问题选择器',
					maxmin : true,
					content : questionDialogSrc
				});
			}
			
			function dialogReturn(index, data) {
				var params = [];
				data = eval("(" + data + ")");
				if(index == needQuesDialogIndex) {
					params.push({
						name : 'data',
						value : data.data
					}, {
						name : 'descId',
						value : data.descId
					});
					onQuestionDialogReturn(params);
				}
				//问题追加
				if(index == quesEquipmentDialogIndex) {
					params.push({name:'itemId',value:data.itemId},{name:'index',value:data.index},{name:'oldQuesDeduct',value:data.oldQuesDeduct},{name:'scrollTop',value:data.scrollTop});
					onQuesEquipDialogReturn(params);
					
				}
			}
			function afterUpdataPlist() {
				setDtHeight(scrollTop);
			}
			var cmark;
			function close(mark) {
				if (mark) {
					cmark = mark;
				}
				var index = parent.layer.getFrameIndex(window.name);
				if (parent.dialogReturn) {
					parent.dialogReturn(index, cmark);
				}
				parent.layer.close(index);
			}
			function openAlertDialog() {
				layer.open({
					type:1,
					title: '提示',
					content: $('#alertDialog'),
					btn:false,
				});
			}
			function closeAlertDialog() {
				layer.closeAll('page');
			}
		</script>
	</ui:define>
 	
	<ui:define name="content">
		
			<h:form id="inStationDetailForm" style="width:100%;">
				<p:confirmDialog global="true" showEffect="fade" hideEffect="fade">
					<p:commandButton value="是" type="button" styleClass="ui-confirmdialog-yes" icon="ui-icon-check" />
					<p:commandButton value="否" type="button" styleClass="ui-confirmdialog-no" icon="ui-icon-close" />
				</p:confirmDialog>
				<p:growl id="message" showDetail="true"/>
				<p:toolbar >
					<f:facet name="left">
						<p:panelGrid>
							<p:row>
								<p:column style="padding:0px">
									<p:commandButton title="高级查询" icon="fa fa-angle-double-right" oncomplete="PF('inspectionItemTreeSideBar').show()" style="margin-right:10px"
										actionListener="#{inspectionStationDeductController.beforeOpenSideBar()}" update="sidebarForm"/>
								</p:column>
								<p:column style="padding:0px">
									<h:outputLabel style="padding-top:4px" for="status" value="状态：" />
								</p:column>
								<p:column style="padding:0px">
									<p:selectOneRadio id="status" value="#{inspectionStationDeductController.status}" unselectable="true">
							            <f:selectItem itemLabel="全部" itemValue="0" />
							            <f:selectItem itemLabel="已完成" itemValue="1" />
							            <f:selectItem itemLabel="未完成" itemValue="2" />
							            <p:ajax event="change" oncomplete="setDtHeight()" listener="#{inspectionStationDeductController.queryByStatus()}" update="plist"/>
							        </p:selectOneRadio>
						        </p:column>
							</p:row>
						</p:panelGrid>
						
					</f:facet>
					<f:facet name="right">
						<!-- <p:commandButton value="保存" icon="ui-icon-disk" style="margin-right:10px" 
							disabled="#{!inspectionStationDeductController.editable}" 
							actionListener="#{inspectionStationDeductController.save()}" /> -->
						<!-- <p:commandButton value="提交" icon="ui-icon-arrowthick-1-n"
							disabled="#{!inspectionStationDeductController.editable}"
							actionListener="#{inspectionStationDeductController.submit()}">
							<p:confirm header="提示" message="您还有 #{inspectionStationDeductController.getUnFinishedCount()}项未进行评价，确定提交吗?" icon="ui-icon-alert" />
						</p:commandButton> -->
						<p:commandButton value="提交" icon="ui-icon-arrowthick-1-n"
							disabled="#{!inspectionStationDeductController.editable}"
							onclick="openAlertDialog()">
						</p:commandButton>
					</f:facet>
				</p:toolbar>
			</h:form>
			<h:form id="basicInfoForm">
				<p:panelGrid cellpadding="5" style="width:100%;border-bottom: 1px solid #999;">
					<p:row style="border:1px solid #d2d6de">
		            	<p:column style="border:1px solid #d2d6de;width:10%;text-align:right">
		            		<p:outputLabel value="评价对象："></p:outputLabel>
		            	</p:column>
		            	<p:column style="color:blue;border:1px solid #d2d6de;">
		            		<p:outputLabel value="#{inspectionStationDeductController.currentInspectionStation.stationName}"></p:outputLabel>
		            	</p:column>
		            	<p:column style="border:1px solid #d2d6de;width:10%;text-align:right">
		            		<p:outputLabel value="总评价项："></p:outputLabel>
		            	</p:column>
		            	<p:column style="color:red;border:1px solid #d2d6de;text-align:center">
		            		<p:outputLabel value="#{inspectionStationDeductController.totalItemCount}"></p:outputLabel>
		            	</p:column>
		                <p:column style="border:1px solid #d2d6de;width:10%;text-align:right">
		                	<p:outputLabel value="评价计划时间："></p:outputLabel>
		                </p:column>
		                <p:column style="color:red;border:1px solid #d2d6de;text-align:center">
		                	<p:outputLabel value="#{inspectionStationDeductController.getInspectionTimeStr()}"></p:outputLabel>
		                </p:column>
		                <p:column style="border:1px solid #d2d6de;text-align:right;width:10%">
		            		<p:outputLabel value="实际开始时间："></p:outputLabel>
		            	</p:column>
		                <p:column style="color:blue;border:1px solid #d2d6de;text-align:center">
		                	<h:outputText readonly="true"  value="#{inspectionStationDeductController.currentInspectionStation.actualStartTime}"  >
					       		<f:convertDateTime pattern="yyyy-MM-dd HH:mm:ss" timeZone="GMT+8"/>  
				   		    </h:outputText>
		                </p:column>
		            </p:row>
		            <p:row style="border:1px solid #d2d6de">
		            	<p:column style="border:1px solid #d2d6de;text-align:right">
		                	<p:outputLabel value="评价专家："></p:outputLabel>
		                </p:column>
		                <p:column style="color:blue;text-align:left;border:1px solid #d2d6de">
		                	<p:outputLabel value="#{inspectionStationDeductController.currentInspectionStation.inspectionExpert}"></p:outputLabel>
		                </p:column>
		                <p:column style="border:1px solid #d2d6de;text-align:right">
		                	<p:outputLabel value="已完成项："></p:outputLabel>
		                </p:column>
		                <p:column style="color:blue;text-align:center;border:1px solid #d2d6de">
		                	<p:outputLabel value="#{inspectionStationDeductController.finishedItemCount}"></p:outputLabel>
		                </p:column>
		            	<p:column style="border:1px solid #d2d6de;text-align:right">
		            		<p:outputLabel value="扣分合计："></p:outputLabel>
		            	</p:column>
		            	<p:column style="color:red;text-align:left;border:1px solid #d2d6de" colspan="3">
		            		<p:outputLabel id="realDeductpoints" value="#{inspectionStationDeductController.currentInspectionStation.deduct}"></p:outputLabel>
		            	</p:column>		            	
		            	<!-- <p:column style="border:1px solid #d2d6de;text-align:right">
		            		<p:outputLabel value="合计实扣："></p:outputLabel>
		            	</p:column>
		            	<p:column style="color:red;text-align:left;border:1px solid #d2d6de">
		            		<p:outputLabel id="deductpoints" value="#{inspectionStationDeductController.currentInspectionStation.deduct}"></p:outputLabel>
		            	</p:column> -->
		            </p:row>
				</p:panelGrid>
			</h:form>
			<!-- 加载提示 -->
			<div id="loadingTip" class="loadingCover">
				<div style="position:absolute;top:50%;left:50%;margin-left:-50px;margin-top:-50px;color:white;font-weight:bold;font-size:18px;">数据导入中...</div>
			</div>
			<s:dataTable id="plist" value="#{inspectionStationDeductController.selectLists}" rowIndexVar="ite"    
				var="item" sortBy="#{item.projectOrder}" emptyMessage="无记录" style="text-align:center;" scrollable="true" scrollHeight="0">	
						
				<f:facet name="header">
					<h:outputText value="#{inspectionStationDeductController.currentInspectionStation.stationName}评价详细" />
					<!-- <h:outputText style="color:blue" value="#{inspectionStationDeductController.statusTitle}" /> -->
					<!-- <p:commandButton style="background-color:#dd4b39;border:#dd4b39;color:#333;margin-left:20px" icon="fa fa-android"
						title="一键完成" actionListener="#{inspectionStationDeductController.setItemFinishedAutomatically()}" 
						update="plist basicInfoForm" oncomplete="afterUpdataPlist()">
						<p:confirm header="提示" message="您还有 #{inspectionStationDeductController.getUnFinishedCount()}项未进行评价，确定全部完成评价吗?" icon="ui-icon-alert" />
					</p:commandButton> -->
				</f:facet>
				<p:headerRow>
					<p:column colspan="18" style="text-align:left">
						<h:outputText value="#{item.projectNo}、#{item.projectName}"/> 
					</p:column>
				</p:headerRow>
				<s:column groupRow="true" style="text-align:center" headerText="评价项目">
					<h:outputText value="#{item.itemNo}.#{item.itemName}" />
					<h:outputText style="color:red" value="（扣分上限：#{item.itemDeductionCeiling}）" rendered="#{item.itemDeductionCeiling!=0}"></h:outputText>
				</s:column>
				<s:column groupRow="true" style="text-align:center" headerText="检查要素及要求" colspan="2">
					<h:outputText value="#{item.inspectionNo}.#{item.inspectionName}" />
					<h:outputText style="color:blue" value="（"></h:outputText>
					<h:outputText style="color:blue" value="扣分上限：" rendered="#{item.inspectiontDeductionCeiling!=0}"></h:outputText>
					<h:outputText style="color:red" value="#{item.inspectiontDeductionCeiling}" rendered="#{item.inspectiontDeductionCeiling!=0}"></h:outputText>
					<h:outputText style="color:blue" value="，" rendered="#{item.inspectiontDeductionCeiling!=0}"></h:outputText>
					<h:outputText style="color:blue" value="扣分合计：" ></h:outputText>
					<h:outputText style="color:red" value="#{item.requirementDeduct}"></h:outputText>
					<h:outputText style="color:blue" value="）"></h:outputText>
				</s:column>
				<s:column groupRow="true" style="text-align:center;" headerText="评分标准" colspan="2">
					<h:outputText value="#{item.scoreNo}.#{item.scoreName}" />					
					<!-- <h:outputText rendered="#{item.deductionCriteria!=0}" style="color:blue" value="（评分标准：#{item.deductionCriteria}/个）"></h:outputText> -->
					<h:outputText style="color:red" value="（扣分上限：#{item.deductionCeiling}）" rendered="#{item.deductionCeiling!=0}"></h:outputText>
				</s:column>
				 <s:column style="text-align:center" headerText="风险等级" groupRow="true" groupRowBase="#{item.inspectionId}" >
				 	<h:outputText style="display:none" value="#{item.inspectionId}" />
				 	<h:outputText value="#{item.riskLevel}" />					
				</s:column>				
				<s:column headerText="问题设备"  colspan="4">
					<h:form id="problemDescriptionForm">
						<p:panelGrid style="margin-top:0px;" >
						    <p:row style="border:0;">
						        <p:column rowspan="2" style="font-weight: bold; width:80%;padding:0px" >								
									<p:dataList value="#{item.getQuestionEquipments()}" var="quesEqu" type="ordered" rendered="#{item.getQuestionEquipments().size() >0}"
										><!-- style="height:100px;overflow-y:scroll" -->								       
								        #{quesEqu.equipmentName} <br/> <h:outputText style="color:red" value="（问题数量：#{quesEqu.questionAmount}，"></h:outputText> 
								        <h:outputText style="color:red" value="应扣：#{quesEqu.quesDeduct}）"></h:outputText>
								    </p:dataList>
								</p:column>
								<p:column rowspan="2" style="font-weight: bold;padding:0" >
									 <p:commandLink title="问题设备追加" id="quesEquBtn" 
									 	disabled="#{!inspectionStationDeductController.editable}"
									 	onclick="openQuestionEquipmentDialog(
										 	'#{item.inspectionItemId}',
										 	'#{item.deductionCriteria}',
										 	'#{inspectionStationDeductController.currentInspectionStation.id}',
										 	'#{inspectionStationDeductController.currentInspectionStation.stationId}',
										 	'#{item.planId}',
										 	'#{ite}');" 
										class="fa fa-pencil" type="button"  />	
									 <p:remoteCommand name="onQuesEquipDialogReturn" 
									 	update ="plist basicInfoForm quesEquBtn alertForm" 
									 	actionListener="#{inspectionStationDeductController.onEquipmentDialogReturn()}"
									 	oncomplete="afterUpdataPlist()"/>		
								</p:column>
								<p:column rowspan="2" style="font-weight: bold;padding:0" >
									<p:commandButton title="问题设备图片" icon="fa fa-file-image-o" style="background: #759F84;border:1px solid #759F84;margin-bottom:2px"
										update="viewForm" oncomplete="PF('viewDialog').show()" 
										actionListener="#{inspectionStationDeductController.findImagesByItem(item)}" /><br/>
									<p:commandButton title="问题设备视频" icon="fa fa-file-video-o" style="background: #EF8E28;border:1px solid #EF8E28;margin-top:2px"
										update="videoForm" oncomplete="PF('videoDialog').show()" 
										actionListener="#{inspectionStationDeductController.findVideosByItem(item)}" />
								</p:column>
						    </p:row>
						</p:panelGrid>
    				</h:form>
				</s:column>
				<s:column headerText="问题描述" colspan="2">
					<h:form>
						<h:inputTextarea value="#{item.problemDescription}" style="width:100%;height:65px;border:1px solid #ccc" disabled="#{!inspectionStationDeductController.editable}">
							<p:ajax event="blur" listener="#{inspectionStationDeductController.onRemarkerBlur(item)}"></p:ajax>
						</h:inputTextarea>
					</h:form>
				</s:column>
				<s:column headerText="整改建议" colspan="2">
					<h:form>
						<h:inputTextarea value="#{item.recommendation}" style="width:100%;height:65px;border:1px solid #ccc" disabled="#{!inspectionStationDeductController.editable}">
							<p:ajax event="blur" listener="#{inspectionStationDeductController.onRemarkerBlur(item)}"></p:ajax>
						</h:inputTextarea>
					</h:form>
				</s:column>
				<s:column headerText="操作">
					<h:form id="checkForm">
						<h:outputText value="完成" style="color:blue" rendered="#{item.status==1 and item.deductionCriteria!=0}" />
						<p:commandButton title="设置为已完成" icon="fa fa-check" style="background: #dd4b39;border:1px solid #dd4b39" rendered="#{item.status==0 and item.deductionCriteria!=0}"
							disabled="#{!inspectionStationDeductController.editable}"
							actionListener="#{inspectionStationDeductController.setItemFinished(item)}" update="checkForm basicInfoForm alertForm" />
					</h:form>
				</s:column>
				<s:column headerText="被检单位反馈意见"  colspan="3">
					<h:form>
						<p:panelGrid style="margin-top:0px;" >
							    <p:row style="border:0">
							    	<p:column style="width:85%;padding:0px">
							    		<h:inputTextarea id="feedback" style="width:99%;color:black;height:65px;border:1px solid #ccc"
											disabled="#{!inspectionStationDeductController.stationPersonnelLogin}"
											value="#{item.feedback}">
											<p:ajax event="change" listener="#{inspectionStationDeductController.onFeedbackBlur(item)}"></p:ajax>
										</h:inputTextarea>
							    	</p:column>
							    	<p:column style="font-weight: bold;padding:0" >
										<p:commandButton title="图片" icon="fa fa-file-image-o" style="background: #759F84;border:1px solid #759F84;margin-bottom:2px"
											update="feedbackViewForm" oncomplete="PF('feedbackViewDialog').show()"  
											actionListener="#{inspectionStationDeductController.findFeedbackImagesByItem(item)}" /><br/>
										<p:commandButton title="视频" icon="fa fa-file-video-o" style="background: #EF8E28;border:1px solid #EF8E28;margin-top:2px"
											update="feedbackVideoForm" oncomplete="PF('feedbackVideoDialog').show()"  
											actionListener="#{inspectionStationDeductController.findFeedbackVideosByItem(item)}" />
									</p:column>
							    </p:row>
						</p:panelGrid>
					</h:form>
				</s:column>
			</s:dataTable>
			
			<!-- 图片查看 -->
			<p:dialog widgetVar="viewDialog" header="图片查看" modal="true" id="viewDialog" width="1050" height="700">
				<h:form id="viewForm">
					<p:galleria value="#{inspectionStationDeductController.imagePaths}" var="image" panelWidth="950" panelHeight="600"
						showCaption="true" autoPlay="false">
						<p:graphicImage value="#{request.contextPath}/getServerImage?fullPath=#{image}" title='#{image}' />
					</p:galleria>
				</h:form> 
			</p:dialog>
			
			<p:dialog widgetVar="feedbackViewDialog" header="图片查看" modal="true" id="feedbackViewDialog" width="850" height="400">
				<h:form id="feedbackViewForm">
					<p:toolbar id="feedbackViewDialogToolbar" style="margin-bottom:10px">
						<f:facet name="left">
							<p:commandButton value="编辑" actionListener="#{inspectionStationDeductController.editFeedbackView(0)}"
								disabled="#{!inspectionStationDeductController.stationPersonnelLogin}"
								update="@form" rendered="#{inspectionStationDeductController.feedbackViewEditable==false}"
								icon="fa fa-pencil"></p:commandButton>
							<p:commandButton value="上传" actionListener="#{inspectionStationDeductController.preUploadImage()}" oncomplete="PF('uploadImageDlg').show()"
								disabled="#{!inspectionStationDeductController.stationPersonnelLogin}"
								rendered="#{inspectionStationDeductController.feedbackViewEditable==false}"
								icon="fa fa-upload"></p:commandButton>
								
							<p:commandButton value="完成" actionListener="#{inspectionStationDeductController.editFeedbackView(1)}" 
								style="background-color:#dd4b39;border:1px solid #dd4b39;"
								update="@form" rendered="#{inspectionStationDeductController.feedbackViewEditable==true}"></p:commandButton>
						</f:facet>
					</p:toolbar>
					<p:lightBox styleClass="imagebox" rendered="#{inspectionStationDeductController.feedbackViewEditable==false}">
						<p:repeat var="image" value="#{inspectionStationDeductController.imagePaths}">
							<h:outputLink value="#{request.contextPath}/getServerImage?fullPath=#{image}" title=''>
								<p:graphicImage value="#{request.contextPath}/getServerImage?fullPath=#{image}" style="height:77px;width:100px;padding-bottom:5px" />
							</h:outputLink>
						</p:repeat>
					</p:lightBox>
					
					<p:repeat var="image" value="#{inspectionStationDeductController.imagePaths}">
						<p:panel style="float:left;padding:0;margin:0;border:0;">
							<p:commandLink class="fa fa-trash" rendered="#{inspectionStationDeductController.feedbackViewEditable==true}"
								style="position: absolute;font-size:18px;color:green;margin-left:2px;"
								title="删除" actionListener="#{inspectionStationDeductController.deleteByImagePath(image)}" update="@form inStationDetailForm:message" />
							
							<p:graphicImage value="#{request.contextPath}/getServerImage?fullPath=#{image}" 
								style="height:77px;width:100px;padding-bottom:10px;opacity:0.6;margin-left:16px" 
								rendered="#{inspectionStationDeductController.feedbackViewEditable==true}"  />
							<!-- <br/>
							<p:commandLink class="fa fa-circle-thin" style="margin-left:50px;margin-bottom:3px;font-size:16px"
								actionListener=""
								rendered="#{inspectionStationDeductController.feedbackViewEditable==true and false}" />
							<p:commandLink class="fa fa-check-circle" style="margin-left:50px;margin-bottom:3px;font-size:17px;color:#00a65a"
								rendered="#{inspectionStationDeductController.feedbackViewEditable==true and true}" /> -->
						</p:panel>
					</p:repeat>
					
				</h:form>
			</p:dialog>
			
			<!-- 视频列表查看 -->
			<p:dialog widgetVar="videoDialog" header="视频列表" modal="true" id="videoDialog" width="1050" height="600">
				<h:form id="videoForm">
					<p:dataTable id="videoTb" widgetVar="videoTb" value="#{inspectionStationDeductController.videoDTOs}" 
						emptyMessage="无记录" rowIndexVar="ite" var="item" rowKey="item.id">
						<p:column headerText="序号"  style="width:5%">
							<h:outputText value="#{ite+1}" />
						</p:column>
						<p:column headerText="问题设备" style="width:25%">
							<h:outputText value="#{item.equipment.stationName} - #{item.equipment.equipmentName}"/>
						</p:column>
						<p:column headerText="视频名称" style="width:30%">
							<p:commandLink title="删除" style="margin-right:5px;float:left;"
								styleClass="ui-icon ui-icon-trash" update="videoForm:videoTb inStationDetailForm:message"
								actionListener="#{inspectionStationDeductController.deleteRecordImage(item)}"
								disabled="#{!inspectionStationDeductController.editable}">
								<p:confirm header="提示" message="确定删除该记录吗?" icon="ui-icon-alert" />
							</p:commandLink>
							<!-- <h:outputText value="#{item.record.name}" /> -->
							<p:commandLink value="#{item.record.name}" title="点击下载" update="inStationDetailForm:message"
								actionListener="#{inspectionStationDeductController.downLoadVideo(item.record)}" >
								<p:fileDownload value="#{inspectionStationDeductController.file}" />
							</p:commandLink>
							
						</p:column>
						<p:column headerText="上传时间" style="width:25%">
							<h:outputText value="#{item.record.createDate}" />
						</p:column>
						<p:column headerText="上传人" style="width:15%">
							<h:outputText value="#{item.createrName}" />
						</p:column>
					</p:dataTable>
				</h:form> 
			</p:dialog>
			
			<p:dialog widgetVar="feedbackVideoDialog" header="视频查看" modal="true" id="feedbackVideoDialog" width="850" height="400">
				<h:form id="feedbackVideoForm">
					<p:commandButton value="上传" icon="fa fa-upload" style="margin-bottom:5px"
						rendered="#{inspectionStationDeductController.stationPersonnelLogin}"
						actionListener="#{inspectionStationDeductController.preUploadImage()}" oncomplete="PF('uploadVideoDlg').show()" />
					<p:dataTable id="videoTb" widgetVar="videoTb" value="#{inspectionStationDeductController.videoDTOs}" 
						emptyMessage="未上传视频" rowIndexVar="ite" var="item" style="text-align:center;" >
						<p:column headerText="序号"  style="width:10%">
							<h:outputText value="#{ite+1}" />
						</p:column>
						<p:column headerText="视频名称" style="width:30%">
							<h:outputText value="#{item.record.name}" />
						</p:column>
						<p:column headerText="上传时间" style="width:25%">
							<h:outputText value="#{item.record.createDate}" />
						</p:column>
						<p:column headerText="上传人" style="width:15%">
							<h:outputText value="#{item.createrName}" />
						</p:column>
						<p:column>
							<p:commandLink title="点击下载" class="fa fa-download" style="color:#00a65a" update="inStationDetailForm:message"
								actionListener="#{inspectionStationDeductController.downLoadVideo(item.record)}" >
								<p:fileDownload value="#{inspectionStationDeductController.file}" />
							</p:commandLink>
							<p:commandLink title="删除" style="margin-left:20px"
								styleClass="fa fa-trash" update="feedbackVideoForm:videoTb inStationDetailForm:message"
								actionListener="#{inspectionStationDeductController.deleteRecordImage(item)}"
								rendered="#{inspectionStationDeductController.stationPersonnelLogin}">
								<p:confirm header="提示" message="确定删除该视频吗?" icon="ui-icon-alert" />
							</p:commandLink>
							
						</p:column>
					</p:dataTable>
				</h:form> 
			</p:dialog>
			<!-- 上传图片 -->
			<p:dialog header="上传图片" widgetVar="uploadImageDlg" modal="true" id="uploadImageDlg" width="700" height="300">
				<h:form>
					<p:fileUpload style="margin-top:10px" id="fileUpload" cancelLabel="取消" sizeLimit="1000000" fileLimit="1"
						mode="advanced" dragDropSupport="false" allowTypes="/(\.|\/)(gif|jpe?g|png)$/"
						oncomplete="PF('uploadImageDlg').hide()" update="fileUpload inStationDetailForm:message "
						fileUploadListener="#{inspectionStationDeductController.handleImageFileUpload}"
						uploadLabel="上传" label="图片" />
				</h:form>
			</p:dialog>
			<!-- 上传视频 -->
			<p:dialog header="上传视频" widgetVar="uploadVideoDlg" modal="true" id="uploadVideoDlg" width="700" height="300">
				<h:form>
				<p:fileUpload id="videoUpload" style="margin-top:10px" cancelLabel="取消" fileLimit="1"
					mode="advanced" dragDropSupport="false"
					oncomplete="PF('uploadVideoDlg').hide()" update="videoUpload inStationDetailForm:message"
					fileUploadListener="#{inspectionStationDeductController.handleVideoFileUpload}"
					uploadLabel="上传" label="视频" />
				</h:form>
			</p:dialog>
			
			<h:form id="sidebarForm">
			<p:sidebar widgetVar="inspectionItemTreeSideBar" baseZIndex="10000">
			    <p:toolbar style="width:100%;margin-top:20px">
			    	<f:facet name="left">
			    		<h:outputLabel value="高级查询" />
			    	</f:facet>
			    	<f:facet name="right">
			    		<p:commandButton value="确定" oncomplete="PF('inspectionItemTreeSideBar').hide();setDtHeight()"
			    			actionListener="#{inspectionStationDeductController.showSelectedNodeToModel()}" update="plist"/>
			    	</f:facet>
			    </p:toolbar>
			    <p:tree id="itemTree" widgetVar="itemTree" dynamic="true" 
					animate="true" var="node" style="border: 1px solid #ccc;height:600px;width:100%;overflow-y: scroll;" 
					value="#{inspectionStationDeductController.itemRoot}"
					selection="#{inspectionStationDeductController.selectedItemNodes}" selectionMode="checkbox">
					<p:ajax event="select"/>
					<p:ajax event="unselect" />
					<p:treeNode type="ROOTNAME" icon="fa fa-file-word-o">
						<h:outputText rendered="#{node.status==0}" value="#{node.content}" />
						<h:outputText rendered="#{node.status==1}" value="#{node.content}" style="color:blue"/>
					</p:treeNode>
					<p:treeNode type="INSPECTIONPROJECT" icon="fa fa-files-o">
						<h:outputText rendered="#{node.status==0}" value="#{node.content}" />
						<h:outputText rendered="#{node.status==1}" value="#{node.content}" style="color:blue"/>
					</p:treeNode>
					<p:treeNode type="INSPECTIONITME" icon="fa fa-file-o">
						<h:outputText rendered="#{node.status==0}" value="#{node.content}" />
						<h:outputText rendered="#{node.status==1}" value="#{node.content}" style="color:blue"/>
					</p:treeNode>
					<p:treeNode type="INSPECTIONREQUIREMENT" icon="fa fa-file-text-o">
						<h:outputText rendered="#{node.status==0}" value="#{node.content}" />
						<h:outputText rendered="#{node.status==1}" value="#{node.content}" style="color:blue"/>
					</p:treeNode>
					<p:treeNode type="INSPECTIONCRITERION" icon="fa fa-star-o">
						<h:outputText rendered="#{node.status==0}" value="#{node.content}" />
						<h:outputText rendered="#{node.status==1}" value="#{node.content}" style="color:blue"/>
					</p:treeNode>
				</p:tree>
			</p:sidebar>
			</h:form>
			<!-- 提示弹窗 -->
			<div id="alertDialog" style="display:none;padding:20px">
				<h:form id="alertForm">
					<h:outputText value="您有 #{inspectionStationDeductController.totalItemCount-inspectionStationDeductController.finishedItemCount}项未进行评价，确定提交吗?" />
					<p:panelGrid style="width:100%;margin-top:15px">
						<p:row style="border:none">
							<p:column style="border:none;float:right">
								<!-- <p:commandButton value="继续" oncomplete="closeAlertDialog()" actionListener="#{inspectionStationDeductController.submit()}"/> -->
								<p:commandButton value="确定" oncomplete="closeAlertDialog()" actionListener="#{inspectionStationDeductController.setItemFinishedAutomatically()}"/>
								<p:commandButton value="取消" oncomplete="closeAlertDialog()"/>
							</p:column>
						</p:row>
					</p:panelGrid>
				</h:form>
			</div>
			
	</ui:define>
</ui:composition>

